<?php $this->placeholder('onReady')->captureStart() ?>
	$("#<?php echo $this->id_tablesorter?>").tablesorter(); 
    
    $("a.enlace_img").click(function (e) {
        e.preventDefault()
        var src=$(this).children().attr('src')
        src=src+'/json/1';
        location.href=src;
	}).css('cursor','pointer')
    
<?php $this->placeholder('onReady')->captureEnd() ?>


<div class="contenedor_tablesorter">


<?php echo $this->InsertarFila($this->controllerName,$this->idZona)?>

<table id="<?= $this->id_tablesorter?>" width="100%" class="tablesorter"> 
    <caption>
       <div id="total_table_filter" style="float: right;">Total <span class="filtradas"><?=count($this->rows)?> Registros</span></div>    
    </caption>
<thead>
<tr>
<?foreach($this->columnas as $v):?>
    <th><?php echo $this->translate($v['header']);?></th>
<?endforeach?>
<th class="filter-false">Adjunto</th>
<th class="filter-false"></th>
</tr>
</thead>
<tbody>
    <?php echo $this->partialLoop($this->controllerName.'/fila.phtml', (array)$this->rows); ?>	
</tbody>
<tfoot>
    <tr>
    <th></th>
    <th></th>
    <th><?=$this->NumEs($this->suma['consumo'],0)?> kWh</th>
    <th><?=$this->NumEs($this->suma['potencia'],0)?> kW</th>
    <th></th>
    <th><?=$this->NumEs($this->suma['importe'],0)?> €</th>
    <th></th>
    <th></th>
    <th></th>
    </tr>
</tfoot>
</table>


<div>
<?if($this->id_proveedor):?>
<a class="enlace_img"><img src="/grafico/proveedor/id/<?=$this->id_proveedor?>/key/potencia/w/600" /></a>
<a class="enlace_img"><img src="/grafico/proveedor/id/<?=$this->id_proveedor?>/key/consumo/w/600"/></a>
<a class="enlace_img"><img src="/grafico/proveedor/id/<?=$this->id_proveedor?>/key/importe/w/600"/></a>
<a class="enlace_img"><img src="/grafico/proveedor/id/<?=$this->id_proveedor?>/key/precio/w/600"/></a>
<?else:?>
<a class="enlace_img"><img src="/grafico/proveedor/idZona/<?=$this->idZona?>/key/potencia/w/600" /></a>
<a class="enlace_img"><img src="/grafico/proveedor/idZona/<?=$this->idZona?>/key/consumo/w/600"/></a>
<a class="enlace_img"><img src="/grafico/proveedor/idZona/<?=$this->idZona?>/key/importe/w/600"/></a>
<a class="enlace_img"><img src="/grafico/proveedor/idZona/<?=$this->idZona?>/key/precio/w/600"/></a>

<?endif?>
</div>


</div>
